﻿<%@ Page Title="" Language="C#" validateRequest=false  MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="DMNoiDen.aspx.cs" Inherits="Admin_DanhMuc_DMNoiDen" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
        .style1
        {
            color: #15428b;
            font-weight: bold;
            width: 99px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePlaceHolder" Runat="Server">
<script type="text/javascript">
    var GB_ROOT_DIR = "../../GREY_BOX/";
    </script>
    <script language="javascript" type="text/javascript">
        function Upload_HinhAnh() {
            var sFileName = document.getElementById('<%=H_AnhDaiDien.ClientID%>').value;
            var url = "../Admin/DanhMuc/UploadImage.aspx?sFileName=" + sFileName;
            return GB_showCenter('Tải ảnh đại diện', url, 220, 500);
        }
        function Insert_Image(imgPath, imgName) {
            document.getElementById('<%=imgViewer.ClientID%>').src = imgPath;
            document.getElementById('<%=H_AnhDaiDien.ClientID%>').value = imgName;
        } 
    </script>
    <script src="../../GREY_BOX/AJS.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/AJS_fx.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/gb_scripts.js" type="text/javascript"></script>
<div class="hrm_header_placeholder">
        Danh mục Nơi đến</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <asp:Panel ID="PanelAdd" Width="100%" GroupingText="Cập nhật thông tin" runat="server">
    <div style="float: right; left: 0; width: 20%;">
        <table border="0" width="100%" align="right" cellpadding="0" cellspacing="0">
            <tr>
                <td width="100%" height="105" style="padding-left: 25px">
                    <asp:Image ID="imgViewer" ToolTip="Ảnh Đại Diện" runat="server" ImageUrl="~/Images/no_image.jpg"
                        CssClass="imgviewer" onclick="JavaScript:Upload_HinhAnh()" Width="130" Height="105" />
                </td>
            </tr>
            <tr>
                <td style="padding: 5px">
                    &nbsp;&nbsp;(Kích vào hình để tải ảnh đại diện)
                </td>
            </tr>
        </table>
    </div>
    <div style="padding: ; width: 80%;">
        <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
        <asp:HiddenField ID="H_AnhDaiDien" Value="" runat="server" />
        
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                
                <tr>
                    <td width="20">
                    </td>
                    <td width="110" class="hrm_title_blue">
                    </td>
                    <td width="7" class="hrm_title_blue">
                    </td>
                    <td>
                        <asp:Label ID="lblStatus" ForeColor="Red" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Loại Tour</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td width="400">
                        <asp:DropDownList ID="cboLoaiTour" CssClass="hrm_combobox" Width="205px" runat="server">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                            InitialValue="0" ControlToValidate="cboLoaiTour" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Tên địa điểm nơi đến</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txtTen" CssClass="hrm_textbox" Width="400px" MaxLength="50" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                            ControlToValidate="txtTen" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Giới thiệu</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td>
                         <FTB:FreeTextBox ID="txtGioiThieu" ImageGalleryPath="~/Upload/Tour" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|InsertImageFromGallery,InsertTable,Preview,WordClean"
                                runat="Server" Width="600px" Height="150px" />
                         <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" SetFocusOnError="True"
                                ControlToValidate="txtGioiThieu" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                     </td>
                </tr>

                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="110" class="hrm_title_blue">
                    </td>
                    <td width="7" class="hrm_title_blue">
                    </td>
                    <td>
                        <asp:ImageButton ID="cmdSave" ImageUrl="~/Images/save.jpg" runat="server" OnClick="cmdSave_Click" />
                        <asp:ImageButton ID="cmdReset" CausesValidation="false" ImageUrl="~/Images/huy.jpg"
                            runat="server" OnClick="cmdReset_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="8">
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="PanelList" Width="100%" Height="355" GroupingText="Danh sách" runat="server">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="20">
                    </td>
                    <td style="padding-right: 15px">
                        <asp:Panel ID="PanelGrid" Width="100%" runat="server">
                            <br />
                            <asp:GridView ID="gridCatalog" runat="server" DataKeyNames="Id" Width="100%" BackColor="White"
                                OnRowCommand="gridCatalog_RowCommand" OnRowDataBound="gridCatalog_RowDataBound"
                                OnRowDeleting="gridCatalog_RowDeleting" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                                BorderColor="#CCCCCC" AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px"
                                CellPadding="3">
                                <Columns>
                                    <asp:BoundField DataField="id" Visible="false" HeaderText="id"></asp:BoundField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="7%" 
                                        HeaderText="Sửa">
                                     <ItemTemplate>
                                           <asp:ImageButton ID="cmdSelects" runat="server" CssClass="command_button" CausesValidation="false"
                                            CommandName="Select" ToolTip="Click để sửa" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("id") %>' />
                                     </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="7%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="7%" 
                                        HeaderText="Xóa">
                                        <ItemTemplate>
                                           <asp:ImageButton ID="cmdDelete" runat="server" CssClass="command_button" CausesValidation="false"
                                                        CommandName="Delete" ToolTip="Click để xóa" ImageUrl="~/Images/DeleteRed.png" CommandArgument='<%# Eval("id") %>' />
                                     </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="7%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Loại Tour"
                                        ItemStyle-Width="120">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTP" CssClass="ogiua" runat="server" Text='<%# GetLoaiTour(Eval("IdLoaiTour")) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="TenNoiDen" ItemStyle-Width="54%" HeaderText="Tên địa điểm nơi đến">
                                    </asp:BoundField>
                                </Columns>
                                <RowStyle ForeColor="#000066" />
                                <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                                <HeaderStyle BackColor="#006699" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />
                            </asp:GridView>
                        </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" height="10">
                         <cc1:Pager ID="Pager1" runat="server" PreviousClause="" NextClause="" LastClause=""
                            FirstClause="" PageClause="Trang" OfClause="/" PageSize="10" OnCommand="Pager1_Command">
                        </cc1:Pager>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

